package com.yxkj.syh.app.huarong.bean;


import com.syh.app.basic.App;
import com.syh.app.basic.utils.ComUtil;
import com.yxkj.syh.app.huarong.R;
import com.yxkj.syh.app.huarong.constants.OrderStatus;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 支出单
 * </p>
 *
 * @author dengyejun
 * @since 2020-04-24
 */
public class PayOrderInfo implements Serializable {

    private Long id;

//    @ApiModelProperty(name = "no", value = "流水号")
    private String no;

//    @ApiModelProperty(name = "empId", value = "申请人id")
    private Long empId;

//    @ApiModelProperty(name = "toOrderId", value = "直达车运输单id")
    private Long toOrderId;

//    @ApiModelProperty(name = "toOrderNo", value = "直达车运输单号")
    private String toOrderNo;

//    @ApiModelProperty(name = "returnOrderId", value = "回头车运输单id")
    private Long returnOrderId;

//    @ApiModelProperty(name = "returnOrderNo", value = "回头车运输单号")
    private String returnOrderNo;

//    @ApiModelProperty(name = "preMileage", value = "上次里程数（km）")
    private Integer preMileage;

//    @ApiModelProperty(name = "nowMileage", value = "本次里程数（km）")
    private Integer nowMileage;

//    @ApiModelProperty(name = "fuelConsumption", value = "加油量（L）油耗（L）")
    private BigDecimal fuelConsumption;

//    @ApiModelProperty(name = "fuelPrice", value = "燃油单价")
    private BigDecimal fuelPrice;

//    @ApiModelProperty(name = "aveConsumption", value = "油耗（L）")
    private BigDecimal aveConsumption;

//    @ApiModelProperty(name = "totalFuel", value = "总油费")
    private BigDecimal totalFuel;

//    @ApiModelProperty(name = "borrowingAmount", value = "借款金额")
    private BigDecimal borrowingAmount;

//    @ApiModelProperty(name = "borrowingTime", value = "借款时间")
//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
//    @DateTimeFormat("yyyy-MM-dd")
    private String borrowingTime;

//    @ApiModelProperty(name = "totalCost", value = "费用总额")
    private BigDecimal totalCost;

//    @ApiModelProperty(name = "refundableFee", value = "应退费用")
    private BigDecimal refundableFee;

//    @ApiModelProperty(name = "isRejected", value = "驳回标志", notes = "0-正常，1-驳回")
    private Integer isRejected;

//    @ApiModelProperty(name = "status", value = "状态", notes = "0-待审核，1-财务审核，2-待退款，3-已完成，-1-已取消")
    private Integer status;

//    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

//    @ApiModelProperty(name = "creator", value = "创建人")
//    @TableField(fill = FieldFill.INSERT)
    private String creator;

//    @ApiModelProperty(name = "updator", value = "修改人")
//    @TableField(fill = FieldFill.UPDATE)
    private String updator;

//    @ApiModelProperty(name = "createTime", value = "创建时间")
//    @TableField(fill = FieldFill.INSERT)
    private String createTime;

//    @ApiModelProperty(name = "updateTime", value = "修改时间")
//    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateTime;

//    @ApiModelProperty(name = "expensesDetailList", value = "支出单详情集合")
//    @TableField(exist = false)
    private List<PayOrderDetailInfo> expensesDetailList;

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public Long getToOrderId() {
        return toOrderId;
    }

    public void setToOrderId(Long toOrderId) {
        this.toOrderId = toOrderId;
    }

    public String getToOrderNo() {
        return toOrderNo;
    }

    public void setToOrderNo(String toOrderNo) {
        this.toOrderNo = toOrderNo;
    }

    public Long getReturnOrderId() {
        return returnOrderId;
    }

    public void setReturnOrderId(Long returnOrderId) {
        this.returnOrderId = returnOrderId;
    }

    public String getReturnOrderNo() {
        return returnOrderNo;
    }

    public void setReturnOrderNo(String returnOrderNo) {
        this.returnOrderNo = returnOrderNo;
    }

    public Integer getPreMileage() {
        return preMileage;
    }

    public void setPreMileage(Integer preMileage) {
        this.preMileage = preMileage;
    }

    public Integer getNowMileage() {
        return nowMileage;
    }

    public void setNowMileage(Integer nowMileage) {
        this.nowMileage = nowMileage;
    }

    public BigDecimal getFuelConsumption() {
        return fuelConsumption;
    }

    public void setFuelConsumption(BigDecimal fuelConsumption) {
        this.fuelConsumption = fuelConsumption;
    }

    public BigDecimal getFuelPrice() {
        return fuelPrice;
    }

    public void setFuelPrice(BigDecimal fuelPrice) {
        this.fuelPrice = fuelPrice;
    }

    public BigDecimal getAveConsumption() {
        return aveConsumption;
    }

    public void setAveConsumption(BigDecimal aveConsumption) {
        this.aveConsumption = aveConsumption;
    }

    public BigDecimal getTotalFuel() {
        return totalFuel;
    }

    public void setTotalFuel(BigDecimal totalFuel) {
        this.totalFuel = totalFuel;
    }

    public BigDecimal getBorrowingAmount() {
        return borrowingAmount;
    }

    public void setBorrowingAmount(BigDecimal borrowingAmount) {
        this.borrowingAmount = borrowingAmount;
    }

    public String getBorrowingTime() {
        return borrowingTime;
    }

    public void setBorrowingTime(String borrowingTime) {
        this.borrowingTime = borrowingTime;
    }

    public BigDecimal getTotalCost() {
        return totalCost;
    }

    public void setTotalCost(BigDecimal totalCost) {
        this.totalCost = totalCost;
    }

    public BigDecimal getRefundableFee() {
        return refundableFee;
    }

    public void setRefundableFee(BigDecimal refundableFee) {
        this.refundableFee = refundableFee;
    }

    public Integer getIsRejected() {
        return isRejected;
    }

    public void setIsRejected(Integer isRejected) {
        this.isRejected = isRejected;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getUpdator() {
        return updator;
    }

    public void setUpdator(String updator) {
        this.updator = updator;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public List<PayOrderDetailInfo> getExpensesDetailList() {
        return expensesDetailList;
    }

    public void setExpensesDetailList(List<PayOrderDetailInfo> expensesDetailList) {
        this.expensesDetailList = expensesDetailList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /* ----------------------------------------------------------------------------------------------------------- */

    public String getTotalCostText(){
        return ComUtil.clearNoUseZero(refundableFee).toPlainString()+"元";
    }


    public String getStatusText() {
        switch (status) {
            case OrderStatus
                    .WAIT_SHIPMENTS:
                return "待发车";//待发车
            case OrderStatus
                    .ALREADY_SHIPMENTS:
                return "运输中";//运输中
            case OrderStatus
                    .ALREADY_RECEIVING:
                return "已签收";//已签收
            case OrderStatus
                    .ALREADY_INVALID:
                return "已取消";//已取消
        }
        return "--";
    }

    public int statusTextColor() {
        switch (status) {
            case OrderStatus.WAIT_SHIPMENTS:
            case OrderStatus.ALREADY_SHIPMENTS:
            case OrderStatus.ALREADY_RECEIVING:
                return App.getApplication().getColor(R.color.defaultOrange);
            case OrderStatus.ALREADY_INVALID:
                return App.getApplication().getColor(R.color.textColor5);

            default:
                return App.getApplication().getColor(R.color.defaultOrange);
        }
    }


}
